# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Simon Rupf <simon@rupf.net>
pkgname=man-db
pkgver=2.12.0
pkgrel=1
pkgdesc="The man command and related utilities for examining on-line help files"
url="https://man-db.gitlab.io/man-db/"
arch="all"
license="GPL-2.0-or-later"
depends="groff less"
makedepends="gdbm-dev gettext-dev libpipeline-dev zlib-dev libseccomp-dev"
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.savannah.nongnu.org/releases/man-db/man-db-$pkgver.tar.xz
	ignore.patch
	"
triggers="man-db.trigger=/usr/share/man"

# allow main/mandoc to provide this first
provides="doc-provider"
provider_priority=10

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-setuid \
		--with-sections="1 1p 1x 2 2x 3 3p 3const 3head 3type 3x 4 4x 5 5x 6 6x 7 7x 8 8x 9 0p tcl n l p o" \
		--enable-nls \
		--with-db=gdbm \
		--with-systemdsystemunitdir=no \
		--with-systemdtmpfilesdir=no \
		--with-libseccomp
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
4b644a508cf10ef6d27b6325b08f8a89e0695bbc1409bf420efd27649c6851860cc472c4d86063f7b71dccd01fb158faa82afa1e2b91c9a20154acf66b0349bf  man-db-2.12.0.tar.xz
5cde2df35dc4db182ed8290023c8f8ff4e34fe66f9aacb8bca63ac51f65a3433a0699e04e674dc57b489eed3cb4ff55b3605ca635394df1078ed79c81e372c07  ignore.patch
"
